package com.coocaa.aries.core.tool;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;

/**
 * @author : bijiahao
 * @date : 2019/4/9.
 * @description:<p> </p>
 */
public class InstanceUtil {
    public static final <E> ArrayList<E> newArrayList() {
        return new ArrayList();
    }

    public static final <E> ArrayList<E> newArrayList(int initSize) {
        return new ArrayList(initSize);
    }

    public static final <E> ArrayList<E> newArrayList(E... e) {
        ArrayList<E> list = new ArrayList();
        Collections.addAll(list, e);
        return list;
    }

    public static final <k, v> HashMap<k, v> newHashMap() {
        return new HashMap();
    }

    public static final <k, v> HashMap<k, v> newHashMap(int initSize) {
        return new HashMap(initSize);
    }

    public static final <E> HashSet<E> newHashSet() {
        return new HashSet();
    }

    public static final <E> HashSet<E> newHashSet(int initSize) {
        return new HashSet(initSize);
    }


    public static final <E> HashSet<E> newHashSet(E... e) {
        HashSet<E> set = new HashSet();
        Collections.addAll(set, e);
        return set;
    }
}
